package com.hk.web.domain.entity;

import com.hk.commons.domain.entity.IdEntity;
import com.hk.commons.enums.Whether;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;

/**
 *
 * @author Antinomy
 * @date 17/11/1
 */
@Entity
@EntityListeners(AuditingEntityListener.class)
public class Merchant extends IdEntity {

    @Column(columnDefinition = "varchar(50) comment '名字'")
    private String name;

    @Column(columnDefinition = "varchar(255) comment '商户回调url'")
    private String url;

    @Column(columnDefinition = "varchar(255) comment '商户公钥'")
    private String merchantKey;

    @Column(columnDefinition = "varchar(255) comment '商户秘钥'")
    private String merchantSecret;

    @Column(columnDefinition = "varchar(10) NOT NULL comment '是否启用'")
    @Enumerated(EnumType.STRING)
    private Whether enable = Whether.NO;

    @Column(columnDefinition = "bigint comment '商户历史Id'")
    private Long merchantHistoryId;

    @Column(columnDefinition = "varchar(500) comment '商户简介'")
    private String info;

    @Column(columnDefinition = "int(2) comment '商户类型'")
    public Integer type;


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getMerchantKey() {
        return merchantKey;
    }

    public void setMerchantKey(String merchantKey) {
        this.merchantKey = merchantKey;
    }

    public String getMerchantSecret() {
        return merchantSecret;
    }

    public void setMerchantSecret(String merchantSecret) {
        this.merchantSecret = merchantSecret;
    }

    public Whether getEnable() {
        return enable;
    }

    public void setEnable(Whether enable) {
        this.enable = enable;
    }

    public Long getMerchantHistoryId() {
        return merchantHistoryId;
    }

    public void setMerchantHistoryId(Long merchantHistoryId) {
        this.merchantHistoryId = merchantHistoryId;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }
}
